<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<link type="text/css" rel="stylesheet"
	href="<c:url value='/css/UDStyle.css'/>" media="screen" />
<script type="text/javascript" src="<c:url value='/js/UDCore.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/UDModules.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/DrawXml.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/jquery.min.js'/>"></script>
<script type="text/javascript">
	$(document).ready(
			function() {

				var uri = "${uri}";
				var entityName = "${entityName}";
				jQuery.ajax({
					type : 'GET',
					contentType : 'application/json',
					url : '${pageContext.request.contextPath}/diagram/json/'
							+ uri + "?entityName=" + entityName,
					dataType : 'json',
					success : function(data) {
						if (data && data.success == "true") {
							var width = window.innerWidth - 250;

							if (width < 400)
								width = 400;
							if (width > 1000)
								width = 1100;

							var app = new Application({
								id : 'umldiagram',
								width : width,
								height : 600
							});
							app.setXMLString(data.xml);
							$('#debug').html(data.xml);
						}
					},
					error : function() {
						alert("error");
					}
				});
			});
</script>
<div id="umldiagram"></div>